<%@ tag language="java" pageEncoding="UTF-8"%>

<%@ attribute name="name" rtexprvalue="true" required="true"%>
<%@ attribute name="size" rtexprvalue="true"%>
<%@ attribute name="label" rtexprvalue="true"%>
<%@ attribute name="rows" rtexprvalue="true"%>
<%@ attribute name="cols" rtexprvalue="true"%>
<%@ attribute name="required" rtexprvalue="true"%>
<%@ attribute name="value" rtexprvalue="true"%>
<%@ attribute name="single" rtexprvalue="true"%>
<%@ attribute name="help" rtexprvalue="true"%>
<%@ attribute name="onchange" rtexprvalue="true"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<c:if test="${rows==null}">
	<c:set value="3" var="rows" />
</c:if>
<c:if test="${cols==null}">
	<c:set value="70" var="cols" />
</c:if>

<c:if test="${size==null}">
	<c:set var="size" value="30"/>
</c:if>

<c:if test="${required==null}">
	<c:set var="required" value="false" />
</c:if>


<c:choose>
	<c:when test="${single==null}">
		<c:set var="single" value="1" />
	</c:when>
	<c:when test="${single==1}">
		<c:set var="single" value="3" />
	</c:when>
	<c:otherwise>
		<c:set var="single" value="1" />
	</c:otherwise>
</c:choose>

<th>
	<c:if test="${required}"><label class="requireField">*</label></c:if>
	<label>${label}:</label>
</th>

<td colspan="${single}">
	<textarea maxlength="${size}" name="${name}" rows="${rows}" <c:if test="${onchange!=null}"> onchange="${onchange}"</c:if>
		cols="${cols}">${value}</textarea>${help}
</td>